Skip to content

add option to capture cliCommand output#197

Merged
theodore-s-beers merged 2 commits into
mainfrom
tsb_cli_stdout
Jul 6, 2026
Merged

add option to capture cliCommand output#197
theodore-s-beers merged 2 commits into
mainfrom
tsb_cli_stdout

Conversation

@theodore-s-beers

Copy link
Copy Markdown
Member
  • Add stdoutVariables support for CLI command steps
  • Capture regex groups from command output into shared lesson variables
  • Surface stdout variable parse errors in local CLI evaluation

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for extracting values from CLI command stdout into shared lesson variables, and ensures parse/validation errors for that extraction are reported during local CLI evaluation.

Changes:

  • Introduce stdoutVariables on CLI command steps, with {name, regex} definitions.
  • Parse command stdout using regex capture groups and store matches into the shared variables map.
  • Surface stdout-variable parsing errors in local evaluation via a new Err field on CLICommandResult, plus new tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
client/lessons.go Extends CLI lesson schema with stdoutVariables and adds Err to CLI command results for local error surfacing.
checks/cli.go Implements stdout-variable parsing via regex capture groups and propagates parse errors back through command results.
checks/local.go Fails local evaluation early when a CLI command result contains a parse error (result.Err).
checks/local_test.go Adds coverage to ensure local evaluation reports stdout-variable parse errors as structured failures.
checks/cli_test.go Adds tests for capturing stdout variables and interpolating captured values into subsequent commands.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread checks/cli.go
@theodore-s-beers theodore-s-beers merged commit 20fc7e5 into main Jul 6, 2026
1 check passed
@theodore-s-beers theodore-s-beers deleted the tsb_cli_stdout branch July 6, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants